﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" EnableEventValidation="true"
    AutoEventWireup="true" EnableViewState="true" CodeBehind="frmBook.aspx.cs" Inherits="ClientSide.frmReservations"
    Title="Books" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <div id="choiceFields" class="choiceFields">
        <asp:Label ID="lblFrom" runat="server" Text="From" CssClass="label"></asp:Label>
        <asp:DropDownList ID="ddStartPoint" runat="server" CssClass="dropDown">
        </asp:DropDownList>
        <asp:Label ID="lblTo" runat="server" Text="То" CssClass="label"></asp:Label>
        <asp:DropDownList ID="ddEndPoint" runat="server" CssClass="dropDown">
        </asp:DropDownList>
        <asp:Label ID="lblDate" runat="server" CssClass="label" Text="Date"></asp:Label>
        <asp:TextBox ID="tbDate" runat="server" CssClass="tbDate" ValidationGroup="dateGroup"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfvDate" runat="server" ErrorMessage="Date required"
            ControlToValidate="tbDate" Display="Dynamic" ValidationGroup="dateGroup"></asp:RequiredFieldValidator>
        <cc1:CalendarExtender ID="calender_CalendarExtender" runat="server" Enabled="True"
            TargetControlID="tbDate">
        </cc1:CalendarExtender>
        <asp:Button ID="btnShow" runat="server" Text="Route" class="bodyButton" ValidationGroup="dateGroup" />
        <asp:Label ID="lblRequired" runat="server" CssClass="lblRequired"></asp:Label>
    </div>
    <div id="bodyContainer">
        <div class="gridContainer">
            <asp:GridView ID="gvTravelDetails" runat="server" AutoGenerateColumns="False" CellPadding="4"
                ForeColor="#333333" GridLines="None" CssClass="grid" OnRowCommand="Row_Command" OnRowCancelingEdit="Row_Canceling">
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <Columns>
                    <asp:BoundField DataField="DestinationName" HeaderText="Destination" SortExpression="DestinationName" />
                    <asp:BoundField DataField="StartHour" HeaderText="Departure" SortExpression="StartHour" />
                    <asp:ButtonField DataTextField="WaysStationNames" HeaderText="Route" SortExpression="WaysStationNames"
                        ControlStyle-Font-Underline="false" CommandName="Route" ButtonType="Link" Text="WaysStationNames" />
                    <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
                    <asp:ButtonField ButtonType="Button" Text="Book" CommandName="Book" ControlStyle-CssClass="bodyButton"/>
                    <asp:ButtonField ButtonType="Button" Text="Cancel" ControlStyle-CssClass="bodyButton" CommandName="Cancel" />
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#780000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <asp:Panel ID="panelPass" runat="server" CssClass="passFields">
                <div class="subPass">
                    <div class="passBtn">
                        <asp:Button ID="btnConfirm" runat="server" Text="Confirm" ValidationGroup="tbPass"
                            CssClass="bodyButton" />
                    </div>
                    <div class="passTb">
                        <asp:TextBox ID="tbPassengers" runat="server" CssClass="tbPass" ValidationGroup="tbPass"></asp:TextBox>
                    </div>
                    <div class="lblPass">
                        <asp:Label ID="lblPassenegers" runat="server" Text="Passengers count"></asp:Label>
                    </div>
                    <div class="fake">
                    </div>
                </div>
            </asp:Panel>
            <asp:RegularExpressionValidator ID="revPassengers" runat="server" ErrorMessage="Count must be one or two digit possitiv number"
                ControlToValidate="tbPAssengers" ValidationExpression="[1-9][0-9]?" ValidationGroup="tbPass"></asp:RegularExpressionValidator>
            <asp:RequiredFieldValidator ID="rfvPassenger" runat="server" ErrorMessage="Passenger count required"
                ControlToValidate="tbPassengers" ValidationGroup="tbPass"></asp:RequiredFieldValidator>
        </div>
        <asp:Panel ID="panelDetails" runat="server" CssClass="divDetails">
            <div class="row">
                <div class="destName">
                    <asp:Label ID="lblDestName" runat="server"></asp:Label>
                </div>
            </div>
            <asp:Repeater ID="repDetails" runat="server">
                <ItemTemplate>
                    <div class="row">
                        <div class="detailsN">
                            <asp:Label ID="wayStationName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Name") %>'></asp:Label>
                        </div>
                        <div class="details">
                            <asp:Label ID="wayStationPrice" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Price",
              "{0:0.00}") %>'></asp:Label>
                        </div>
                        <div class="details">
                            <asp:Label ID="wayStationTime" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Time") %>'></asp:Label>
                        </div>
                        <div class="details">
                            <asp:Label ID="wayStationStay" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Stay") %>'></asp:Label>
                        </div>
                    </div>
                </ItemTemplate>
                <HeaderTemplate>
                    <div class="row">
                        <div class="detHeaderN">
                            <asp:Label ID="lblDetName" runat="server" Text="Name"></asp:Label>
                        </div>
                        <div class="detHeader">
                            <asp:Label ID="lblDetPrice" runat="server" Text="Price*"></asp:Label>
                        </div>
                        <div class="detHeader">
                            <asp:Label ID="lblDetTime" runat="server" Text="Time*"></asp:Label>
                        </div>
                        <div class="detHeader">
                            <asp:Label ID="lblDetStay" runat="server" Text="Stay"></asp:Label>
                        </div>
                    </div>
                </HeaderTemplate>
            </asp:Repeater>
        </asp:Panel>
        <div class="roww">
            <asp:Label ID="lblNote" runat="server" Text="* From the previous station."></asp:Label>
        </div>
        <div class="lblBookNote">
            <asp:Label ID="lblBookNote" runat="server"></asp:Label>
        </div>
    </div>
</asp:Content>
